package com.py.credit.service.impl;

import com.py.credit.common.logs.AccessLogger;
import com.py.credit.common.logs.ExceptionLogger;
import com.py.credit.common.rest.RestServiceResult;
import com.py.credit.dao.RuleBindingDao;
import com.py.credit.dao.UploadPublicDao;
import com.py.credit.dao.UploadXycnDao;
import com.py.credit.entity.*;
import com.py.credit.entity.common.LogEnum;
import com.py.credit.entity.enums.DataCollectionFieldsEnum;
import com.py.credit.service.*;
import com.py.credit.service.excel.read.service.ExcelReadService;
import com.py.credit.service.excel.read.service.InspectDataStyleService;
import com.py.credit.utils.DateUtil;
import com.py.credit.utils.DateUtils;
import com.py.credit.utils.SubmitConvXmlUtils;
import com.py.framework.core.common.Page;
import com.py.framework.core.entity.SysUserEntity;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

/**
 * @author jicm 未完成日志处理
 */
@Component
public class UntreatedFileShedule {

	private final static long DAY_MILL_SECONDS = 24 * 60 * 60 * 1000L;

	private final static int MILL_SEC = 1000;

	private final static int NUM_50000 = 50000;

	private final static String CHECKREPEAT_NO = "N";


	// 台前县行政区划编码
	private static final String TAIQIAN_ADMIN_CODE = "410927";

	// 用于生成当日流水号的计数器，每天重置
	private static AtomicInteger dailySerialNumber = new AtomicInteger(1);

	@Autowired
	private BatchLogService batchLogService;

	@Autowired
	private ExcelReadService excelReadService;

	@Autowired
	private StepLogService stepLogService;

	@Autowired
	private TableService tableService;

	@Autowired
	@Qualifier("default")
	private InspectDataStyleService inspectDataStyleService;

	@Autowired
	private WriteLogsService writeLogsService;

	@Autowired
	private TableService tableServcie;

	@Autowired
	private DataEntryService dataEntryService;

	@Autowired
	private RemoteBaseService remoteBaseService;

	@Autowired
	private ContentService contentService;

	@Autowired
	private DataCollectionService dataCollectionService;

	@Autowired
	private UploadService upLoadService;

	@Autowired
	private UploadPublicDao uploadPublicDao;

	@Autowired
	private UploadXycnDao uploadXycnDao;

	protected String postUrl = "http://59.207.122.239:8080/jiekou/gonggongxinxipingtai_jiekou.php";
	protected String apiKey = "e9287247d4487f2e2187c976aaf628d1";
	protected String xxid = "xxid_001";
	protected String xzxkMethodName = "importPermissionXml";//行政许可
	protected String xzxkMethodId = "10";//行政许可
	protected String xzcfMethodName = "importPenalyXml";//行政处罚
	protected String xzcfMethodId = "11";//行政处罚
	protected String jdjcMethodName = "importJdjcXml";//监督检查
	protected String jdjcMethodId = "12";//监督检查
	protected String xzqzMethodName = "importXzqzXml";//行政强制
	protected String xzqzMethodId = "13";//行政强制
	protected String xzzsMethodName = "importXzzsXml";//行政征收
	protected String xzzsMethodId = "14";//行政征收
	protected String xzjfMethodName = "importXzjfXml";//行政给付
	protected String xzjfMethodId = "15";//行政给付
	protected String xzjlMethodName = "importXzjlXml";//行政奖励
	protected String xzjlMethodId = "16";//行政奖励
	protected String xzcjMethodName = "importXzcjXml";//行政裁决
	protected String xzcjMethodId = "17";//行政裁决
	protected String xzqrMethodName = "importXzqrXml";//行政确认
	protected String xzqrMethodId = "18";//行政确认
	protected String qtxzglMethodName = "importQtxzzfxxXml";//其他行政管理
	protected String qtxzglMethodId = "19";//其他行政管理
	protected String xycnMethodName = "importXycnXml";//信用承诺信息
	protected String xycnMethodId = "21";//信用承诺信息
	protected String ccrwMethodName = "importCcRwXml";//抽查任务
	protected String ccrwMethodId = "23";//抽查任务
	protected String ccjgMethodName = "importCcJgXml";//抽查结果
	protected String ccjgMethodId = "24";//抽查结果

	/**
	 * @throws FileNotFoundException
	 * @throws IOException
	 */
	public Map<String,String> run(String absolutepath) throws FileNotFoundException, IOException {
		Map<String,String> mapresult = new HashMap<String, String>();
		BatchFile batchFile = null;
		long startTimeMill = System.currentTimeMillis();
		int totalCountA = 0;
		int scount = 0;
		int fcount = 0;
		int tsscount = 0;
		int tsfcount = 0;
		try {
			List<BatchFile> list = batchLogService.getUntreatedFiles();
			if (list != null && list.size() > 0) {
				batchFile = list.get(0);
				// 将文件状态标识为处理中
				batchLogService.modify(batchFile.getBatchId(), LogEnum.CLZ);
				// 处理流程日志
				stepLogService.addStepLog(batchFile.getBatchId(), "开始处理上传文件。");
				// 获取实体表信息
				BatchLog batchLog = batchLogService.select(batchFile.getBatchId());
				mapresult.put("batchId", batchFile.getBatchId());
				// 获取用户id
				int userId = batchLog.getManagerId();
				Set<Integer> set = new HashSet<>();
				set.add(userId);
				RestServiceResult data = remoteBaseService.getUsersByIds(set, "");
				List<SysUserEntity> userEntityList = (List<SysUserEntity>) data.getData();
				SysUserEntity userEntity = userEntityList.get(0);
				Long topDeptId = userEntity.getOfficeId();
				String pIds = userEntity.getAllParentId();
				if (StringUtils.isNotBlank(pIds)) {
					String t = StringUtils.split(pIds, ",")[0];
					topDeptId = StringUtils.isNoneBlank(t) ? Long.valueOf(t) : topDeptId;
				}
				Page page = new Page();
				List<String> showColumns = DataCollectionFieldsEnum.getDefaultShowColumnEN();
				SysUser userInfo = new SysUser();
				BeanUtils.copyProperties(userEntity, userInfo);
				List<Map<String, Object>> datainfo = dataCollectionService.getResourceListByConditionForPage(userInfo,
						null, batchLog.getDatasourceId(), "", page, showColumns, null,null);
				int tableId = batchFile.getTableId();
				String tipId = tableId + "_" + topDeptId;
				Map<String, Object> map1 = datainfo.get(0);
				Long l2 = (Long) map1.get("infoId");
				int contentId = l2.intValue();
				TableResult tableResult = contentService.getTableColumns(tableId, contentId, tipId);

				Table table = tableServcie.queryCubeById(batchLog.getTarget());

				StringBuilder filePath = new StringBuilder(200);

				filePath.append(absolutepath);
				filePath.append("/upload");
				filePath.append(batchFile.getFpath());
				filePath.append(batchFile.getFname());

				stepLogService.addStepLog(batchFile.getBatchId(), "解析上传的EXCEL文件。");

				Sheet st = excelReadService.readExcelFileForSheet(filePath.toString());
				List<Column> columns = tableResult.getColumns();


				Workbook wb = null;
				FileInputStream fs = new FileInputStream(filePath.toString());
				wb = new HSSFWorkbook(fs);
				Sheet st1 = wb.getSheetAt(0);
				HSSFRow row0= (HSSFRow) st1.getRow(0);  //获取第一行（excel中的行默认从0开始，所以这就是为什么，一个excel必须有字段列头），即，字段列头，便于赋值
//				HSSFRow row1= (HSSFRow) st1.getRow(1);  //获取第一行（excel中的行默认从0开始，所以这就是为什么，一个excel必须有字段列头），即，字段列头，便于赋值

				FileOutputStream out=new FileOutputStream(filePath.toString());  //  "C:/sgs/upload\\2222.xls"
				Cell cell0 = row0.createCell(row0.getLastCellNum());
				cell0.setCellValue("录入结果（如使用本模板调整，导入前，请将本列删除）");
//				// 创建单元格（Cell）
//				Cell cell = row1.createCell(row1.getLastCellNum());
//				// 设置单元格内容
//				cell.setCellValue("成功");

				Map<String, Object> map = excelReadService.readExcelFileHead(st, batchFile.getBatchId(), columns);
				if (map == null || map.isEmpty()) {
					List<Map<String, Object>> listDataMap2 = new ArrayList<>();
					Map<String, Object> resultMap = readExcelData(batchLog, st, table, columns, absolutepath,st1,listDataMap2);
					listDataMap2 =(List<Map<String, Object>>) resultMap.get("listDataMap");
					int totalCount = (int) resultMap.get("totalCount");
					totalCountA+=totalCount;
					int totalDuplicationCount = (int) resultMap.get("totalDuplicationCount");

					int errorCount = (int) resultMap.get("errorCount");
					fcount+=errorCount;
					int waitCount = (int) resultMap.get("waitCount");
					List<Map<String, Object>> listDataMap = (List<Map<String, Object>>) resultMap.get("listDataMap_new");

					Map<String, Integer> temp = execute("t_"+table.getResourceId(),batchFile.getBatchId(),st1,listDataMap,listDataMap2,batchLog,absolutepath, out,wb);
//					writeLogsService.writeExcelFile(batchLog.getId(), JSONArray.toJSONString(listDataMap2), absolutepath);
					tsscount+= temp.get("tsscount");//成功
					tsfcount+= temp.get("tsfcount");//失败
					//删除错误数据
					uploadPublicDao.deleteDataByBatchIdAndTSZT("t_"+table.getResourceId(),batchFile.getBatchId());
					if (totalCount == 0) {

						batchLogService.modifyBatchLog(batchFile.getBatchId(), LogEnum.EX_RESULT_F, totalCount, 0, 0, 0,
								0, LogEnum.YWC);
						mapresult.put("fail", batchFile.getBatchId());

//						mapresult.put("msg",String.format("本次导入共%s条数据，入库成功%s条，入库失败%s条，推送成功%s条，推送失败%s条",totalCountA,scount,fcount,tsscount,tsfcount));
						mapresult.put("msg",String.format("本次导入共%s条数据，推送成功%s条，推送失败%s条，请查看错误描述，并进行调整后再次录入。",totalCountA,tsscount,totalCountA-tsscount));
						return mapresult;
					} else if (errorCount > 0 || totalDuplicationCount > 0) {

						if (errorCount + totalDuplicationCount == totalCount) {

							batchLogService.modifyBatchLog(batchFile.getBatchId(), LogEnum.EX_RESULT_F, totalCount, 0,
									errorCount, totalDuplicationCount, waitCount, LogEnum.YWC);

						} else {
							scount+=(totalCount - totalDuplicationCount - errorCount);
							batchLogService.modifyBatchLog(batchFile.getBatchId(), LogEnum.EX_RESULT_P, totalCount,
									tsscount, totalCountA-tsscount, totalDuplicationCount,
									waitCount, LogEnum.YWC);
						}
						if((totalCount - totalDuplicationCount - errorCount)>0) {
							mapresult.put("PartialSuccess", batchFile.getBatchId());
						}else {
							mapresult.put("fail", batchFile.getBatchId());
						}

						fcount+=totalDuplicationCount;
//						mapresult.put("msg",String.format("本次导入共%s条数据，入库成功%s条，入库失败%s条，推送成功%s条，推送失败%s条",totalCountA,scount,fcount,tsscount,tsfcount));
						mapresult.put("msg",String.format("本次导入共%s条数据，推送成功%s条，推送失败%s条，请查看错误描述，并进行调整后再次录入。",totalCountA,tsscount,totalCountA-tsscount));

						return mapresult;
					} else {
						scount+=totalCount;
						batchLogService.modifyBatchLog(batchFile.getBatchId(), LogEnum.EX_RESULT_S, totalCount,
								tsscount, totalCountA-tsscount, 0, waitCount, LogEnum.YWC);
					}
				} else {
					writeLogsService.writeLogFile(batchFile.getBatchId(), map.get("ERROR_MESS").toString(),
							absolutepath);
					// 记录错误日志
					stepLogService.addStepLog(batchFile.getBatchId(), "数据有错误: 详情请查阅日志。");
					// //处理未结束写状态
					batchLogService.modifyBatchLog(batchFile.getBatchId(), LogEnum.EX_RESULT_F, 0, 0, 0, 0, 0,
							LogEnum.YWC);
					mapresult.put("error",  map.get("ERROR_MESS").toString());
					mapresult.put("msg","导入失败");
					out.flush();
					wb.write(out);
					out.close();
					return mapresult;
				}

			}
			long endTimeMill = System.currentTimeMillis();
			AccessLogger.info("数据采集总耗时", "", "", "数据采集总耗时" + (endTimeMill - startTimeMill) + "ms");
			mapresult.put("success", "录入成功，已入库");
//			mapresult.put("msg",String.format("本次导入共%s条数据，入库成功%s条，入库失败%s条，推送成功%s条，推送失败%s条",totalCountA,scount,fcount,tsscount,tsfcount));
			mapresult.put("msg",String.format("本次导入共%s条数据，推送成功%s条，推送失败%s条，请查看错误描述，并进行调整后再次录入。",totalCountA,tsscount,totalCountA-tsscount));

			return mapresult;
		} catch (Exception e) {
			stepLogService.addStepLog(batchFile.getBatchId(), "系统异常: 详情请查阅日志。");
			batchLogService.modifyBatchLog(batchFile.getBatchId(), LogEnum.EX_RESULT_F, 0, 0, 0, 0, 0, LogEnum.YWC);
			writeLogsService.writeLogFile(batchFile.getBatchId(), "系统异常，请联系管理员", absolutepath);
			ExceptionLogger.error("未完成日志处理异常", e.getMessage(), e);
			mapresult.put("fail", batchFile.getBatchId());
			mapresult.put("msg","导入失败");
			return mapresult;
		}
		
	}

	private Map<String, Object> readExcelData(BatchLog batchLog, Sheet st, Table table, List<Column> columns,
			String absolutepath,Sheet st1,List<Map<String, Object>> listDataMap2) throws IOException {
		// 是否使用内存表模式 默认为否
		boolean userMemory = false;
		boolean reStart = true;
		// 是否需要验重
		boolean checkRepeat = true;
		int hs=1;
		if (CHECKREPEAT_NO.equals(table.getRepeatCheck())) {
			checkRepeat = false;
		}
		int i = 0;
		List<Map<String, Object>> listDataMap = null;
		List<Integer> zbList = null;
		int totalCount = 0;
		int waitCount = 0;
		int totalDuplicationCount = 0;
		Map<String, Object> checkResultMap = null;
		// 获取错误信息
		String errorMess = null;
		int errorCount = 0;
		int start = 0;
		int end = 0;
		Map<String, Object> resultMap = new HashMap<>();
		int allRowNum = st.getLastRowNum();
		String tableDes = "t_" + table.getResourceId();
		String tableName = null;
		// 数据大于1000条使用内存表方式
//		if (allRowNum > 1000) {
//			userMemory = true;
//			// 生成临时表表名
//			String time = new SimpleDateFormat("yyyyMMdd").format(new java.util.Date());
//			String head = String.format("%09d", System.currentTimeMillis() % DAY_MILL_SECONDS);
//			String body = String.format("%03d", Thread.currentThread().getId());
//			String foot = String.format("%04d", ThreadLocalRandom.current().nextInt(MILL_SEC));
//			tableName = tableDes + "_temp_" + time + head + body + foot;
//			// 创建临时表
//			dataEntryService.createTempTable(tableName, columns);
//		}
		while (reStart) {
			start = i * NUM_50000 + 1;
			end = i * NUM_50000 + NUM_50000;
			if (end > allRowNum) {
				end = allRowNum;
			}
			// 获取相对目录的路径
			listDataMap = excelReadService.readExcelData(table,start, end, st, batchLog.getId(), columns);
			int size = listDataMap.size();

			if (listDataMap.isEmpty() && i == 0) {
				writeLogsService.writeLogFile(batchLog.getId(), "上传文件数据不得为空", absolutepath);
				reStart = false;
			} else if (listDataMap.isEmpty()) {
				reStart = false;
			} else {
				// 处理流程日志
				stepLogService.addStepLog(batchLog.getId(), "解析上传的Excel的" + start + "到" + end + "行数据。");
				// 重复性校验
				stepLogService.addStepLog(batchLog.getId(), "开始重复性校验：" + start + "到" + end + "行数据。");
				long duplicationStartTimeMill = System.currentTimeMillis();
				// 数据重复性校验
				listDataMap2 = (List<Map<String, Object>>) com.alibaba.fastjson.JSONArray.parse(com.alibaba.fastjson.JSONArray.toJSONString(listDataMap));
//				Map<String, Object> duplicationCheck = inspectDataStyleService.duplicationCheck_new(listDataMap, table,
//						columns, userMemory, checkRepeat,st1);
//				long duplicationEndTimeMill = System.currentTimeMillis();
//				AccessLogger.info("数据采集重复性校验耗时", "", "",
//						"数据采集重复性校验耗时" + (duplicationEndTimeMill - duplicationStartTimeMill) + "ms");
//				String duplicationMess = (String) duplicationCheck.get("duplicationMess");
//				int duplicationCount = (int) duplicationCheck.get("duplicationCount");
//				listDataMap2 = (List<Map<String, Object>>) duplicationCheck.get("listDataMap2");
//				if (duplicationCount != 0) {
//					totalDuplicationCount += duplicationCount;
//					writeLogsService.writeLogFile(batchLog.getId(), duplicationMess, absolutepath);
//				}
				stepLogService.addStepLog(batchLog.getId(), "开始数据格式校验：" + start + "到" + end + "行数据。");
				// 数据库规则校验
				long dbStartTimeMill = System.currentTimeMillis();
				Map<String, Object> dbCheck = inspectDataStyleService.dataFormatCheck_new(batchLog, listDataMap, table,
						columns,listDataMap2,st1);
				long dbEndTimeMill = System.currentTimeMillis();
				AccessLogger.info("数据采集数据库规则校验耗时", "", "", "数据采集数据库规则校验耗时" + (dbEndTimeMill - dbStartTimeMill) + "ms");
				if (!CollectionUtils.isEmpty(dbCheck)) {
					int dbCount = Integer.parseInt(String.valueOf(dbCheck.get("count")));
					String dbErr = String.valueOf(dbCheck.get("errMsg"));
					if (dbCount > 0) {
						errorCount += dbCount;
						// 写错误日志
						writeLogsService.writeLogFile(batchLog.getId(), dbErr, absolutepath);
					}
				}
				stepLogService.addStepLog(batchLog.getId(), "开始校验Excel的" + start + "到" + end + "行数据");
				// 规则校验
				long styleStartTimeMill = System.currentTimeMillis();
				checkResultMap = inspectDataStyleService.styleCheck_new(batchLog, listDataMap, table, columns,listDataMap2,st1);
				System.out.println(checkResultMap);
				long styleEndTimeMill = System.currentTimeMillis();
				AccessLogger.info("数据采集表和字段规则校验耗时", "", "",
						"数据采集表和字段规则校验耗时" + (styleEndTimeMill - styleStartTimeMill) + "ms");

				// 获取错误信息
				errorMess = (String) checkResultMap.get("mess");

				int eachErrorCount = (int) checkResultMap.get("errorCount");

				if (eachErrorCount != 0) {

					errorCount += eachErrorCount;
					// 写错误日志
					writeLogsService.writeLogFile(batchLog.getId(), errorMess, absolutepath);

				}

				long dataStartTimeMill = System.currentTimeMillis();
				if (checkRepeat && userMemory) {
					// 使用内存表模式，数据录入至内存表
					stepLogService.addStepLog(batchLog.getId(), "开始将Excel" + start + "到" + end + "行数据录入至临时库。");
					dataEntryService.addDataToTemp(listDataMap, table, batchLog, columns, tableName);
					stepLogService.addStepLog(batchLog.getId(), "结束将Excel" + start + "到" + end + "行数据录入至临时库。");
				} else {
					// 不使用内存表模式，数据直接入库
					stepLogService.addStepLog(batchLog.getId(), "开始将Excel" + start + "到" + end + "行数据录入至清洗库。");
					dataEntryService.addSuccessData(listDataMap, table, batchLog, columns);
					stepLogService.addStepLog(batchLog.getId(), "结束将Excel" + start + "到" + end + "行数据录入至清洗库。");
				}
				long dataEndTimeMill = System.currentTimeMillis();
				AccessLogger.info("数据采集数据入库耗时", "", "", "数据采集数据入库耗时" + (dataEndTimeMill - dataStartTimeMill) + "ms");
				totalCount += size;
			}
			reStart = false;
			i++;
		}
		// 使用临时表模式
		if (userMemory) {
			long memoryStartTimeMill = System.currentTimeMillis();
			try {
				// 更新数据状态，MD5重复的数据标记为R
				if (checkRepeat) {
					stepLogService.addStepLog(batchLog.getId(), "开始临时表数据同步。");
					dataEntryService.updateStatus(tableName, tableDes);
				}
				// 数据拷贝，把临时表的数据同步到实体表中
				stepLogService.addStepLog(batchLog.getId(), "开始数据同步传输。");
				dataEntryService.copyData(tableName, tableDes, columns);
				stepLogService.addStepLog(batchLog.getId(), "结束数据同步传输。");
				// 获取临时表重复数据数量
				if (checkRepeat) {
					int c = dataEntryService.countDataNum(tableName, "R");
					writeLogsService.writeLogFile(batchLog.getId(), "导入数据与库中数据重复"+c+"条", absolutepath);
					// 重复数相加
					totalDuplicationCount = totalDuplicationCount + c;
				}
			} catch (Exception e) {
				ExceptionLogger.error("UntreatedFileShedule#readExcelData",
						"临时表数据同步至实体表异常！临时表:" + tableName + ",实体表:" + tableDes + ",ERROR:" + e.getMessage(), e);
				stepLogService.addStepLog(batchLog.getId(), "临时表数据同步至实体表异常!");
			} finally {
				// 删除临时表
				dataEntryService.dropTempTable(tableName);
				stepLogService.addStepLog(batchLog.getId(), "结束临时表数据同步。");
			}
			long memoryEndTimeMill = System.currentTimeMillis();
			AccessLogger.info("数据采集数据临时表处理耗时", "", "",
					"数据采集临时表处理耗时" + (memoryEndTimeMill - memoryStartTimeMill) + "ms");
		}
		writeLogsService.writeExcelFile(batchLog.getId(), JSONArray.toJSONString(listDataMap2), absolutepath);

		// 数据总量
		resultMap.put("totalCount", totalCount);
		// 重复数量
		resultMap.put("totalDuplicationCount", totalDuplicationCount);
		// 待关联数据量
		resultMap.put("waitCount", waitCount);
		// 未通过校验数量
		resultMap.put("errorCount", errorCount);
		resultMap.put("listDataMap", listDataMap2);
		resultMap.put("listDataMap_new", listDataMap);
		return resultMap;

	}


	/**
	 *
	 * @param tableName 数据表
	 * @param batchId 导入批次id
	 *
	 * @return
	 * @throws UnsupportedEncodingException
	 */

	public Map<String, Integer> execute(String tableName, String batchId,Sheet st1,List<Map<String, Object>> listDataMap,List<Map<String, Object>> listDataMap2,
	BatchLog batchLog, String absolutepath,FileOutputStream out,Workbook wb) throws UnsupportedEncodingException {
		Map<String,Integer> res = new HashMap<>();
		res.put("tsscount",0);
		res.put("tsfcount",0);
		try {
			Date reqDate = new Date();
			if("t_1000000010001_3ioj4gezqu".equals(tableName.toLowerCase())){//0 法人许可
				List<SubmitXzxkBean> xzxkList = upLoadService.getXzXkListByBatchId(batchId);
				List<List<SubmitXzxkBean>> parList = ListUtils.partition(xzxkList, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzxkValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++){//执行5次
						List<SubmitXzxkBean> spXkList = parList.get(i);
						SubmitReqData req = new SubmitReqData();
						req.setXzxk(spXkList);
						// 上报数据转换成xml
						String xzxkXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						//tid  10
						respXzxkValue = doPostSoap(postUrl, xzxkXmlValue,apiKey, xzxkMethodName,xzxkMethodId,xxid);
//					String respXzxkValue = "{\"status\":\"00\",\"zongnum\":1,\"chenggongnum\":0,\"shibainum\":1,\"exlfileid\":\"\",\"subtext\":[{\"hangid\":1,\"zhuangtai\":\"2\",\"cuowustr\":\"\\u5e02\\u63a5\\u53e3\\u53cd\\u9988\\uff1a\\u7701\\u63a5\\u53e3\\u53cd\\u9988TQ\\uff1a\\u672a\\u77e5\\u9519\\u8bef\\u3002\"}]}";
//					String respXzxkValue = "connect timed out";


						//保存返回数据
						recordIds = spXkList.stream().map(SubmitXzxkBean -> SubmitXzxkBean.getId()).collect(Collectors.toList());
						if(respXzxkValue.indexOf("time")==-1&&!"".equals(respXzxkValue.trim())){//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
								org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String)  subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs=listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum()-1);


							if(chenggongnum == 1){//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
								break;
							}else{
								// 设置单元格内容
								if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
								}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
									break;
								}else{
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
									break;
								}


							}
						}else{//超时
							String hs=listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum()-1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,0,reqDate ,resDate,res);
				}

			}else if("t_1000010010003_vVwjDLoDWy".toLowerCase().equals(tableName.toLowerCase())){//1 自然人许可

				List<SubmitXzxkBean> xzxkList = upLoadService.getZrrXzXkListByBatchId(batchId);
				List<List<SubmitXzxkBean>> parList = ListUtils.partition(xzxkList, 1);

				for (int i = 0; i < parList.size(); i++) {
					List<SubmitXzxkBean> spXkList = parList.get(i);
					SubmitReqData req = new SubmitReqData();
					req.setXzxk(spXkList);
					// 上报数据转换成xml
					String xzxkXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzxkValue = doPostSoap(postUrl, xzxkXmlValue,apiKey, xzxkMethodName,xzxkMethodId,xxid);
					Date resDate = new Date();
					//保存返回数据
					List<String> recordIds = spXkList.stream().map(SubmitXzxkBean -> SubmitXzxkBean.getId()).collect(Collectors.toList());
					if(respXzxkValue.indexOf("time")==-1&&!"".equals(respXzxkValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,1,reqDate ,resDate,res);
				}

			}else if("t_1000000010002_xsni4zszp0".equals(tableName.toLowerCase())){//2 法人处罚
				List<SubmitXzcfBean> xzCfList = upLoadService.getFrXzCfListByBatchId(batchId);
				List<List<SubmitXzcfBean>> parList = ListUtils.partition(xzCfList, 1);

				for (int i = 0; i < parList.size(); i++) {
					String respXzxkValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++){//执行5次

						List<SubmitXzcfBean> spCfList = parList.get(i);
						SubmitReqData req = new SubmitReqData();
						req.setXzcf(spCfList);
						// 上报数据转换成xml
						String xzCfXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzxkValue = doPostSoap(postUrl, xzCfXmlValue, apiKey, xzcfMethodName,xzcfMethodId,xxid);
						//保存返回数据
						recordIds = spCfList.stream().map(SubmitXzcfBean -> SubmitXzcfBean.getId()).collect(Collectors.toList());
						if(respXzxkValue.indexOf("time")==-1&&!"".equals(respXzxkValue.trim())){//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
								org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String)  subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs=listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum()-1);


							if(chenggongnum == 1){//
								//
	//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
	//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
								break;
							}else{
								// 设置单元格内容
								if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
								}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
									break;
								}else{
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
									break;
								}


							}
						}else{//超时
							String hs=listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum()-1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,2,reqDate ,resDate,res);
				}

			}else if("t_1000010010004_kfpulzpf7d".equals(tableName.toLowerCase())){//3 自然人处罚
				List<SubmitXzcfBean> xzCfList = upLoadService.getZrrXzCfListByBatchId(batchId);
				List<List<SubmitXzcfBean>> parList = ListUtils.partition(xzCfList, 1);

				for (int i = 0; i < parList.size(); i++) {
					List<SubmitXzcfBean> spCfList = parList.get(i);
					SubmitReqData req = new SubmitReqData();
					req.setXzcf(spCfList);
					// 上报数据转换成xml
					String xzCfXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzxkValue = doPostSoap(postUrl, xzCfXmlValue, apiKey,xzcfMethodName,xzcfMethodId,xxid);
					Date resDate = new Date();
					//保存返回数据
					List<String> recordIds = spCfList.stream().map(SubmitXzcfBean -> SubmitXzcfBean.getId()).collect(Collectors.toList());
					if(respXzxkValue.indexOf("time")==-1&&!"".equals(respXzxkValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,3,reqDate ,resDate,res);
				}
			}else if("t_1000000010252_akk9bUnaL3".toLowerCase().equals(tableName.toLowerCase())) {//4 法人监督检查
				List<SupervisoryReview> list = uploadPublicDao.getSupervisoryReviewByFrByBatchId(tableName,batchId);
				List<List<SupervisoryReview>> parList = ListUtils.partition(list, 1);

				for (int i = 0; i < parList.size(); i++) {
					String respXzxkValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<SupervisoryReview> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzjc(spList);
						String xzjcXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzxkValue = doPostSoap(postUrl, xzjcXmlValue, apiKey, jdjcMethodName, jdjcMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(SupervisoryReview -> SupervisoryReview.getRecordId()).collect(Collectors.toList());
						if (respXzxkValue.indexOf("time") == -1&&!"".equals(respXzxkValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,4,reqDate ,resDate,res);
				}
			}else if("t_1000010010430_E0pP6YlewE".toLowerCase().equals(tableName.toLowerCase())) {//5 自然人监督检查
				List<SupervisoryReview> list = uploadPublicDao.getSupervisoryReviewByZrrByBatchId(tableName,batchId);
				List<List<SupervisoryReview>> parList = ListUtils.partition(list, 1);

				for (int i = 0; i < parList.size(); i++) {

					List<SupervisoryReview> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzjc(spList);
					String xzjcXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzxkValue = doPostSoap(postUrl, xzjcXmlValue, apiKey,jdjcMethodName,jdjcMethodId,xxid);
					Date  resDate = new Date();
					//保存返回数据

					List<String> recordIds = spList.stream().map(SupervisoryReview -> SupervisoryReview.getRecordId()).collect(Collectors.toList());
					if(respXzxkValue.indexOf("time")==-1&&!"".equals(respXzxkValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,5,reqDate ,resDate,res);
				}
			}else if("t_1000000010019_bgWiiN00cb".toLowerCase().equals(tableName.toLowerCase())) {//6 法人行政强制
				List<XzqzEntity> list = uploadPublicDao.getXzqzByFrByBatchId(tableName,batchId);
				List<List<XzqzEntity>> parList = ListUtils.partition(list, 1);

				for (int i = 0; i < parList.size(); i++) {
					String respXzqzValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<XzqzEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzqz(spList);
						String xzqzXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzqzValue = doPostSoap(postUrl, xzqzXmlValue, apiKey, xzqzMethodName, xzqzMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(XzqzEntity -> XzqzEntity.getRecordId()).collect(Collectors.toList());
						if (respXzqzValue.indexOf("time") == -1&&!"".equals(respXzqzValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzqzValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzqzValue,recordIds,6,reqDate ,resDate,res);
					//return respXzqzValue;
				}
			}else if("t_1000010010085_nbWY1hOWBB".toLowerCase().equals(tableName.toLowerCase())) {//7 自然人行政强制
				List<XzqzEntity> list = uploadPublicDao.getXzqzByZrrByBatchId(tableName,batchId);
				List<List<XzqzEntity>> parList = ListUtils.partition(list, 1);

				for (int i = 0; i < parList.size(); i++) {
					List<XzqzEntity> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzqz(spList);
					String xzqzXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					System.out.println("行政强制转XML内容：{}"+xzqzXmlValue);
					String respXzqzValue = doPostSoap(postUrl, xzqzXmlValue, apiKey,xzqzMethodName,xzqzMethodId,xxid);
					//保存返回数据
					Date  resDate = new Date();
					List<String> recordIds = spList.stream().map(XzqzEntity -> XzqzEntity.getRecordId()).collect(Collectors.toList());
					if(respXzqzValue.indexOf("time")==-1&&!"".equals(respXzqzValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzqzValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzqzValue,recordIds,7,reqDate ,resDate,res);
				}
			}else if("t_1000000010045_6HelrLv0OJ".toLowerCase().equals(tableName.toLowerCase())) {//8 法人行政征收
				List<XzzsEntity> list = uploadPublicDao.getXzzsFrByBatchId(tableName,batchId);
				List<List<XzzsEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzzsValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<XzzsEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzzs(spList);
						String xzzsXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						System.out.println("行政征收转XML内容：{}" + xzzsXmlValue);
						respXzzsValue = doPostSoap(postUrl, xzzsXmlValue, apiKey, xzzsMethodName, xzzsMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(XzzsEntity -> XzzsEntity.getRecordId()).collect(Collectors.toList());
						if (respXzzsValue.indexOf("time") == -1&&!"".equals(respXzzsValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzzsValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzzsValue,recordIds,8,reqDate ,resDate,res);
				}
			}else if("t_1000010010089_NKoHe65W3V".toLowerCase().equals(tableName.toLowerCase())) {//9 自然人行政征收
				List<XzzsEntity> list = uploadPublicDao.getXzzsByZrrByBatchId(tableName,batchId);
				List<List<XzzsEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					List<XzzsEntity> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzzs(spList);
					String xzzsXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzzsValue = doPostSoap(postUrl, xzzsXmlValue, apiKey,xzzsMethodName, xzzsMethodId,xxid);
					//保存返回数据
					Date  resDate = new Date();
					List<String> recordIds = spList.stream().map(XzzsEntity -> XzzsEntity.getRecordId()).collect(Collectors.toList());
					if(respXzzsValue.indexOf("time")==-1&&!"".equals(respXzzsValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzzsValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzzsValue,recordIds,9,reqDate ,resDate,res);
				}
			}else if("t_1000000010081_B1jxBXNyHJ".toLowerCase().equals(tableName.toLowerCase())) {//10 法人行政给付
				List<XzjfEntity> list = uploadPublicDao.getXzjfByFrByBatchId(tableName,batchId);
				List<List<XzjfEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzjfValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<XzjfEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzjf(spList);
						String xzjfXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzjfValue = doPostSoap(postUrl, xzjfXmlValue, apiKey, xzjfMethodName, xzjfMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(XzjfEntity -> XzjfEntity.getRecordId()).collect(Collectors.toList());
						if (respXzjfValue.indexOf("time") == -1&&!"".equals(respXzjfValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzjfValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：数据库已经存在该数据") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzjfValue,recordIds,10,reqDate ,resDate,res);

				}
			}else if("t_1000010010092_FnFxdTFOv9".toLowerCase().equals(tableName.toLowerCase())) {//11 自然人行政给付
				List<XzjfEntity> list = uploadPublicDao.getXzjfByZrrByBatchId(tableName,batchId);
				List<List<XzjfEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					List<XzjfEntity> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzjf(spList);
					String xzjfXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzjfValue = doPostSoap(postUrl, xzjfXmlValue, apiKey,xzjfMethodName,xzjfMethodId,xxid);
					Date  resDate = new Date();
					//保存返回数据
					List<String> recordIds = spList.stream().map(XzjfEntity -> XzjfEntity.getRecordId()).collect(Collectors.toList());
					if(respXzjfValue.indexOf("time")==-1&&!"".equals(respXzjfValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzjfValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzjfValue,recordIds,11,reqDate ,resDate,res);
				}
			}else if("t_1000000010082_LuLlDPXj9d".toLowerCase().equals(tableName.toLowerCase())) {//12 法人行政奖励
				List<XzjlEntity> list = uploadPublicDao.getXzjlByFrByBatchId(tableName,batchId);
				List<List<XzjlEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzjlValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<XzjlEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzjl(spList);
						String xzjlXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzjlValue = doPostSoap(postUrl, xzjlXmlValue, apiKey, xzjlMethodName, xzjlMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(XzjlEntity -> XzjlEntity.getRecordId()).collect(Collectors.toList());
						if (respXzjlValue.indexOf("time") == -1&&!"".equals(respXzjlValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzjlValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzjlValue,recordIds,12,reqDate ,resDate,res);
				}
			}else if("t_1000010010098_ek9kcfC7gn".toLowerCase().equals(tableName.toLowerCase())) {//13 自然人行政奖励
				List<XzjlEntity> list = uploadPublicDao.getXzjlByZrrByBatchId(tableName,batchId);
				List<List<XzjlEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					List<XzjlEntity> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzjl(spList);
					String xzjlXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzjlValue = doPostSoap(postUrl, xzjlXmlValue, apiKey,xzjlMethodName,xzjlMethodId,xxid);
					Date  resDate = new Date();
					//保存返回数据
					List<String> recordIds = spList.stream().map(XzjlEntity -> XzjlEntity.getRecordId()).collect(Collectors.toList());
					if(respXzjlValue.indexOf("time")==-1||!"".equals(respXzjlValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzjlValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzjlValue,recordIds,13,reqDate ,resDate,res);
				}
			}else if("t_1000000010078_72Blr6pCCj".toLowerCase().equals(tableName.toLowerCase())) {//14 法人行政裁决
				List<XzcjEntity> list = uploadPublicDao.getXzcjByFrByBatchId(tableName,batchId);
				List<List<XzcjEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzcjValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<XzcjEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzcj(spList);
						String xzcjXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzcjValue = doPostSoap(postUrl, xzcjXmlValue, apiKey, xzcjMethodName, xzcjMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(XzcjEntity -> XzcjEntity.getRecordId()).collect(Collectors.toList());
						if (respXzcjValue.indexOf("time") == -1&&!"".equals(respXzcjValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzcjValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzcjValue,recordIds,14,reqDate ,resDate,res);
				}
			}else if("t_1000010010088_bmuDHF0DxX".toLowerCase().equals(tableName.toLowerCase())) {//15 自然人行政裁决
				List<XzcjEntity> list = uploadPublicDao.getXzcjByZrrByBatchId(tableName,batchId);
				List<List<XzcjEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					List<XzcjEntity> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzcj(spList);
					String xzcjXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzcjValue = doPostSoap(postUrl, xzcjXmlValue, apiKey,xzcjMethodName,xzcjMethodId,xxid);
					Date  resDate = new Date();
					//保存返回数据
					List<String> recordIds = spList.stream().map(XzcjEntity -> XzcjEntity.getRecordId()).collect(Collectors.toList());
					if(respXzcjValue.indexOf("time")==-1&&!"".equals(respXzcjValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzcjValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzcjValue,recordIds,15,reqDate ,resDate,res);
				}
			}else if("t_1000000010079_fel4Oc0gfQ".toLowerCase().equals(tableName.toLowerCase())) {//16 法人行政确认
				List<XzqrEntity> list = uploadPublicDao.getXzqrByFrByBatchId(tableName,batchId);
				List<List<XzqrEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzqzValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<XzqrEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzqr(spList);
						String xzqrXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzqzValue = doPostSoap(postUrl, xzqrXmlValue, apiKey, xzqrMethodName, xzqrMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(XzqrEntity -> XzqrEntity.getRecordId()).collect(Collectors.toList());
						if (respXzqzValue.indexOf("time") == -1&&!"".equals(respXzqzValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzqzValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzqzValue,recordIds,16,reqDate ,resDate,res);
				}
			}else if("t_1000010010091_HoTa38mRD1".toLowerCase().equals(tableName.toLowerCase())) {//17 自然人行政确认
				List<XzqrEntity> list = uploadPublicDao.getXzqrByZrrByBatchId(tableName,batchId);
				List<List<XzqrEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					List<XzqrEntity> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzqr(spList);
					String xzqrXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzqzValue = doPostSoap(postUrl, xzqrXmlValue, apiKey,xzqrMethodName,xzqrMethodId,xxid);
					Date  resDate = new Date();
					//保存返回数据
					List<String> recordIds = spList.stream().map(XzqrEntity -> XzqrEntity.getRecordId()).collect(Collectors.toList());
					if(respXzqzValue.indexOf("time")==-1&&!"".equals(respXzqzValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzqzValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzqzValue,recordIds,17,reqDate ,resDate,res);
				}
			}else if("t_1000000010083_bisEXzGGeF".toLowerCase().equals(tableName.toLowerCase())) {//18 法人其他行政管理
				List<XzqtglEntity> list = uploadPublicDao.getXzqtByFrByBatchId(tableName,batchId);
				List<List<XzqtglEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzjcValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<XzqtglEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setXzqtgl(spList);
						String xzqtglXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzjcValue = doPostSoap(postUrl, xzqtglXmlValue, apiKey, qtxzglMethodName, qtxzglMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(XzqtglEntity -> XzqtglEntity.getRecordId()).collect(Collectors.toList());
						if (respXzjcValue.indexOf("time") == -1&&!"".equals(respXzjcValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzjcValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzjcValue,recordIds,18,reqDate ,resDate,res);
				}
			}else if("t_1000010010100_4bjNpPRKrv".toLowerCase().equals(tableName.toLowerCase())) {//19 自然人其他行政管理
				List<XzqtglEntity> list = uploadPublicDao.getXzqtByZrrByBatchId(tableName,batchId);
				List<List<XzqtglEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					List<XzqtglEntity> spList = parList.get(i);
					PublishSubmitReqData req = new PublishSubmitReqData();
					req.setXzqtgl(spList);
					String xzqtglXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzjcValue = doPostSoap(postUrl, xzqtglXmlValue, apiKey,qtxzglMethodName,qtxzglMethodId,xxid);
					Date  resDate = new Date();
					//保存返回数据
					List<String> recordIds = spList.stream().map(XzqtglEntity -> XzqtglEntity.getRecordId()).collect(Collectors.toList());
					if(respXzjcValue.indexOf("time")==-1&&!"".equals(respXzjcValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzjcValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzjcValue,recordIds,19,reqDate ,resDate,res);
				}
			}else if("t_1000000010398_agbpz1ybsl".toLowerCase().equals(tableName.toLowerCase())) {//20 法人信用承诺
				List<FrPromiseEntity> promiseBookList = uploadXycnDao.getFrPromiseBookLlistByBatchId(batchId);
				List<List<FrPromiseEntity>> parList = ListUtils.partition(promiseBookList, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzxkValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<FrPromiseEntity> spList = parList.get(i);
						//承诺做出日期
						String cnzcrq =spList.get(0).getCNZCRQ();
						// 获取当前流水号并自增
						int serial = uploadXycnDao.getFrPromiseBookLlistByCnzcrq(cnzcrq.substring(0,10))+1+i;
						// 格式化流水号为6位，不足前面补0
						String serialStr = String.format("%06d", serial);
						spList.get(0).setCNBM(TAIQIAN_ADMIN_CODE+cnzcrq.substring(0,10).replace("-","").replace("\\/","")+serialStr);
						SubmitXycnReqData req = new SubmitXycnReqData();
						req.setFrPromise(spList);
						// 上报数据转换成xml
						String frcnsXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzxkValue = doPostSoap(postUrl, frcnsXmlValue, apiKey, xycnMethodName, xycnMethodId, xxid);//{"status":"00","zongnum":1,"chenggongnum":1,"shibainum":0,"exlfileid":"","subtext":[{"hangid":1,"zhuangtai":"1","cuowustr":""}]}
//						respXzxkValue = "{\"status\":\"00\",\"zongnum\":1,\"chenggongnum\":1,\"shibainum\":0,\"exlfileid\":\"\",\"subtext\":[{\"hangid\":1,\"zhuangtai\":\"1\",\"cuowustr\":\"\"}]}";
						recordIds = spList.stream().map(FrPromiseEntity -> FrPromiseEntity.getUUID()).collect(Collectors.toList());
						if (respXzxkValue.indexOf("time") == -1&&!"".equals(respXzxkValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,20,reqDate ,resDate,res);
				}
			}else if("t_1000010010567_jvhob4c2lb".toLowerCase().equals(tableName.toLowerCase())) {//21 自然人信用承诺
				List<ZrrPromiseEntity> promiseBookList = uploadXycnDao.getZrrPromiseBookLlistByBatchId(batchId);
				List<List<ZrrPromiseEntity>> parList = ListUtils.partition(promiseBookList, 1);
				for (int i = 0; i < parList.size(); i++) {
					List<ZrrPromiseEntity> spList = parList.get(i);
					SubmitXycnReqData req = new SubmitXycnReqData();
					req.setZrrPromise(spList);
					// 上报数据转换成xml
					String frcnsXmlValue = SubmitConvXmlUtils.convert2Xml(req);
					String respXzxkValue = doPostSoap(postUrl, frcnsXmlValue, apiKey,xycnMethodName,xycnMethodId,xxid);
					Date  resDate = new Date();
					System.out.println("返回行自然人承诺书结果信息：{}" + respXzxkValue);
					List<String> recordIds = spList.stream().map(ZrrPromiseEntity -> ZrrPromiseEntity.getUUID()).collect(Collectors.toList());
					if(respXzxkValue.indexOf("time")==-1&&!"".equals(respXzxkValue.trim())){//没有超时
						JSONParser parser = new JSONParser();

						// 将JSON字符串解析为JSONObject对象
						JSONObject jsonObject = (JSONObject) parser.parse(respXzxkValue);
						// 从JSONObject中获取值
						String status = (String) jsonObject.get("status");//状态
						Long zongnum = (Long) jsonObject.get("zongnum");
						Long chenggongnum = (Long) jsonObject.get("chenggongnum");
						Long shibainum = (Long) jsonObject.get("shibainum");

						String sbyy = "";
						if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
							org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
							String subtext = (String)  subtext11.get(0).toString();//返回值
							JSONObject test = (JSONObject) parser.parse(subtext);
							sbyy = (String) test.get("cuowustr");//状态
						}
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);


						if(chenggongnum == 1){//
							//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
							// 设置单元格内容
							cell.setCellValue("推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","推送成功");
							listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
						}else{
							// 设置单元格内容
							if(sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误")!=-1){//存在
								cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台成功，上报省平台失败：请联系管理员处理！");
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}else if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "0");
							}else{
								cell.setCellValue(sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess",sbyy.toString());
								listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
							}


						}
					}else{//超时
						String hs=listDataMap.get(i).get("rowIndex").toString();
						HSSFRow row1= (HSSFRow) st1.getRow(Integer.parseInt(hs)-1);  //
						// 创建单元格（Cell）
						Cell cell = row1.createCell(row1.getLastCellNum()-1);
						// 设置单元格内容
						cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("errorMess","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
						listDataMap2.get(Integer.parseInt(hs)-2).put("idDel", "1");
					}
					this.doUpdateLog(tableName, respXzxkValue,recordIds,21,reqDate ,resDate,res);
				}
			}else if("t_1000000010410_dwaw88YojG".toLowerCase().equals(tableName.toLowerCase())) {//22 法人抽查任务
				List<CcrwEntity> list = uploadPublicDao.getCcrwByBatchId(tableName,batchId);
				List<List<CcrwEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzqzValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<CcrwEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setCcrw(spList);
						String xzqrXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzqzValue = doPostSoap(postUrl, xzqrXmlValue, apiKey, ccrwMethodName, ccrwMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(CcrwEntity -> CcrwEntity.getRecordId()).collect(Collectors.toList());
						if (respXzqzValue.indexOf("time") == -1&&!"".equals(respXzqzValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzqzValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzqzValue,recordIds,22,reqDate ,resDate,res);
				}
			}else if("t_1000000010409_sUlP9D0Apy".toLowerCase().equals(tableName.toLowerCase())) {//24 法人抽查结果
				List<CcjgEntity> list = uploadPublicDao.getCcjgByBatchId(tableName,batchId);
				List<List<CcjgEntity>> parList = ListUtils.partition(list, 1);
				for (int i = 0; i < parList.size(); i++) {
					String respXzqzValue="";
					List<String> recordIds =new ArrayList<>();
					Date resDate = new Date();
					for(int a = 0; a < 5; a++) {//执行5次
						List<CcjgEntity> spList = parList.get(i);
						PublishSubmitReqData req = new PublishSubmitReqData();
						req.setCcjg(spList);
						String xzqrXmlValue = SubmitConvXmlUtils.convert2Xml(req);
						respXzqzValue = doPostSoap(postUrl, xzqrXmlValue, apiKey, ccjgMethodName, ccjgMethodId, xxid);
						//保存返回数据
						recordIds = spList.stream().map(CcjgEntity -> CcjgEntity.getRecordId()).collect(Collectors.toList());
						if (respXzqzValue.indexOf("time") == -1&&!"".equals(respXzqzValue.trim())) {//没有超时
							JSONParser parser = new JSONParser();

							// 将JSON字符串解析为JSONObject对象
							JSONObject jsonObject = (JSONObject) parser.parse(respXzqzValue);
							// 从JSONObject中获取值
							String status = (String) jsonObject.get("status");//状态
							Long zongnum = (Long) jsonObject.get("zongnum");
							Long chenggongnum = (Long) jsonObject.get("chenggongnum");
							Long shibainum = (Long) jsonObject.get("shibainum");

							String sbyy = "";
							if (jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))) {
								org.json.simple.JSONArray subtext11 = (org.json.simple.JSONArray) jsonObject.get("subtext");
								String subtext = (String) subtext11.get(0).toString();//返回值
								JSONObject test = (JSONObject) parser.parse(subtext);
								sbyy = (String) test.get("cuowustr");//状态
							}
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);


							if (chenggongnum == 1) {//
								//
//						listDataMap2.get(Integer.parseInt(hs)-1).put("errorMess",sbyy.toString());
//						listDataMap2.get(Integer.parseInt(hs)-1).put("idDel", "1");
								// 设置单元格内容
								cell.setCellValue("推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "推送成功");
								listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
								break;
							} else {
								// 设置单元格内容
								if (sbyy.indexOf("市接口反馈：省接口反馈TQ：未知错误") != -1) {//存在
									cell.setCellValue("上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台成功，上报省平台失败：请联系管理员处理！");
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
								} else if (sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复") != -1) {//存在
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "0");
									break;
								} else {
									cell.setCellValue(sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", sbyy.toString());
									listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
									break;
								}


							}
						} else {//超时
							String hs = listDataMap.get(i).get("rowIndex").toString();
							HSSFRow row1 = (HSSFRow) st1.getRow(Integer.parseInt(hs) - 1);  //
							// 创建单元格（Cell）
							Cell cell = row1.createCell(row1.getLastCellNum() - 1);
							// 设置单元格内容
							cell.setCellValue("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("errorMess", "上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
							listDataMap2.get(Integer.parseInt(hs) - 2).put("idDel", "1");
						}
					}
					this.doUpdateLog(tableName, respXzqzValue,recordIds,24,reqDate ,resDate,res);
				}
			}
			out.flush();
			wb.write(out);
			out.close();
			writeLogsService.writeExcelFile(batchLog.getId(), JSONArray.toJSONString(listDataMap2), absolutepath);
		} catch (Exception e) {
			//删除推送失败的数据
//			uploadPublicDao.deleteDataByBatchIdAndTSZT(tableName,batchId);
			e.printStackTrace();
		}
		//删除推送失败的数据
//		uploadPublicDao.deleteDataByBatchIdAndTSZT(tableName,batchId);

		return res;
	}

	public String doPostSoap(String postUrl, String soapXml, String apiKey,
							 String soapAction,String tid,String xxid) throws IOException {
		String StringResult = "";
		//不需要手动关闭httpClient
		OkHttpClient client = new OkHttpClient();
		FormBody.Builder builder = new FormBody.Builder();
		builder.add("APIKEY",apiKey);//接口秘钥
		builder.add("tid",tid);//报送类别ID
		builder.add("MethodName",soapAction);//报送类别方法名称
		builder.add("exlfilelist_id","");//批量报送批次ID，单条报送时为空
		builder.add("xxid", xxid);   //单条报送信息 ID，批次报送时为空
		builder.add("UserCode", "1620"); //在市平台的用户ID
		builder.add("permissionXml", soapXml); //信息主体XML字符串
		Request request = new Request.Builder()
				.url(postUrl).post(builder.build())
				.build();
		setLog(DateUtils.getCurrentFullTime());
		setLog("请求地址:"+ postUrl);
		setLog("请求方法:"+soapAction);
		setLog("APIKEY:"+apiKey);
		setLog("tid:"+tid);
		setLog("MethodName:"+soapAction);
		setLog("exlfilelist_id:");
		setLog("xxid:"+xxid);
		setLog("UserCode:1620");
		setLog("permissionXml:"+soapXml);
		try {
			Response response = client.newCall(request).execute();
			StringResult = response.body().string();
			setLog("请求结果::"+ StringResult);
		} catch (IOException e) {
			StringResult = "errorException:" + e.getMessage();
			setLog("请求失败:"+StringResult);
			e.printStackTrace();

		}
		return StringResult;

	}

	public void doUpdateLog(String tableName, String json, List<String> tid, int type, Date reqDate, Date resDate,Map<String,Integer> res) throws IOException {

		// 创建JSON解析器
		JSONParser parser = new JSONParser();

		// 将JSON字符串解析为JSONObject对象
		try {
			SubmitLogsInfo logsInfo = new SubmitLogsInfo();
			if(json.indexOf("time")==-1&&!"".equals(json.trim())){//没有超时
				JSONObject jsonObject = (JSONObject) parser.parse(json);
				List<String> recordIds = new ArrayList<>();
	//            recordIds.add(tid);
				// 从JSONObject中获取值
				String status = (String) jsonObject.get("status");//状态
				Long zongnum = (Long) jsonObject.get("zongnum");
				Long chenggongnum = (Long) jsonObject.get("chenggongnum");
				Long shibainum = (Long) jsonObject.get("shibainum");

				//插入推送日志
				DateUtil dataUtil = DateUtil.getInstance();
				String batNo = "BN" + dataUtil.getCurrDate(DateUtil.YYYYMMDDHHMMSS);
				String subDate = dataUtil.getCurrDate(DateUtil.YYYY_MM_DD);
				logsInfo.setReqDate(reqDate);
				logsInfo.setResDate(resDate);
				logsInfo.setBatNo(batNo);
				logsInfo.setType(type);
				logsInfo.setSubDate(subDate);
				logsInfo.setRecStatus(status);
				logsInfo.setZongNum(zongnum.toString());
				logsInfo.setSuccNum(chenggongnum.toString());
				logsInfo.setFailNum(shibainum.toString());
				logsInfo.setTabelName(tableName);
				logsInfo.setTid(String.join(",",tid));
				this.setSubmitLogsInfo(tableName, logsInfo,tid);
				String sbyy = "";
				if(jsonObject.get("subtext") != null && !"".equals(jsonObject.get("subtext"))){
					org.json.simple.JSONArray subtext11= (org.json.simple.JSONArray) jsonObject.get("subtext");
					String subtext = (String)  subtext11.get(0).toString();//返回值
//                if(subtext.indexOf("cuowustr")>0){
//                    List<Map> subtexts = JSONArray.parseArray(subtext,Map.class);
//                    for (Map sub: subtexts){
//                        if(sub.get("cuowustr") !=null && !"".equals(sub.get("cuowustr"))){
//                            String  info = Normalizer.normalize(sub.get("cuowustr").toString(), Normalizer.Form.NFKC);
//                            sub.put("cuowustr",info);
//                        }
//                    }
//                    subtext = JSONArray.toJSONString(subtexts);
//                    sbyy = subtexts.get(0).get("cuowustr").toString();
//                }
					JSONObject test = (JSONObject) parser.parse(subtext);
					sbyy = (String) test.get("cuowustr");//状态
					logsInfo.setCuowustr(subtext);
				}

				if(chenggongnum == 1){//更新数据表推送状态
					//
					res.put("tsscount", (int) (res.get("tsscount")+chenggongnum));
					res.put("tsfcount", (int) (res.get("tsfcount")+shibainum));
					uploadPublicDao.updateXzStatusByRecordIds(tableName,"Y","推送成功","",tid);//需改原数据的状态
//                logsInfo.setSuccNum("1" );
//                logsInfo.setFailNum("0");
//                logsInfo.setRecStatus("1");
				}else{
					if(sbyy.indexOf("省接口反馈：上报数据与数据库中数据重复")!=-1){//存在，则认定成功
						res.put("tsscount", (int) (res.get("tsscount")+1));
						res.put("tsfcount", (int) (res.get("tsfcount")+0));
					}else{
						res.put("tsscount", (int) (res.get("tsscount")+chenggongnum));
						res.put("tsfcount", (int) (res.get("tsfcount")+shibainum));
					}
					uploadPublicDao.updateXzStatusByRecordIds(tableName,"N","推送失败",sbyy,tid);//需改原数据的状态
//                JSONObject jsonObject1 = (JSONObject) parser.parse(subtext);
//                logsInfo.setTabelName(tableName);
//                String cuowustr = jsonObject1.get("cuowustr").toString();
//                logsInfo.setSuccNum("0" );
//                logsInfo.setFailNum("1");
//                logsInfo.setRecStatus("1");
//                String  info = Normalizer.normalize(cuowustr, Normalizer.Form.NFKC);
//                logsInfo.setRemarkInfo(info);
				}
				uploadPublicDao.saveSubmitLogsInfo(logsInfo);
			}else{//超时
				//插入推送日志
				DateUtil dataUtil = DateUtil.getInstance();
				String batNo = "BN" + dataUtil.getCurrDate(DateUtil.YYYYMMDDHHMMSS);
				String subDate = dataUtil.getCurrDate(DateUtil.YYYY_MM_DD);
				logsInfo.setReqDate(reqDate);
				logsInfo.setResDate(resDate);
				logsInfo.setBatNo(batNo);
				logsInfo.setType(type);
				logsInfo.setSubDate(subDate);
				logsInfo.setRecStatus("00");
				logsInfo.setZongNum("1");
				logsInfo.setSuccNum("0");
				logsInfo.setFailNum("1");
				logsInfo.setTabelName(tableName);
				logsInfo.setTid(String.join(",",tid));
				this.setSubmitLogsInfo(tableName, logsInfo,tid);
				logsInfo.setCuowustr("上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。");
				uploadPublicDao.updateXzStatusByRecordIds(tableName,"N","推送失败","上报市平台失败：请求市平台接口超时。请确定数据格式无误后，再次导入数据，如连续失败，请联系管理员处理。",tid);//需改原数据的状态
				uploadPublicDao.saveSubmitLogsInfo(logsInfo);
			}

		} catch (ParseException e) {
			e.printStackTrace();
		}
	}

	public void setSubmitLogsInfo(String tableName,SubmitLogsInfo logsInfo,List<String> tid){
		try{
			List<Map<String,Object>> configs = uploadPublicDao.selectSubmitLogsConfigs(tableName);
			List<Map<String,Object>> dataList = uploadPublicDao.selectData(tableName,tid);
			Map<String,Object> config = new HashMap<>();
			for(Map<String,Object> c:configs){
				config.put(c.get("log_filed").toString(),c.get("col_name"));
			}
			String titleName =  dataList.stream().map(d -> getStringToObject(d.get(config.get("titleName")))).collect(Collectors.joining(","));
			String titleId = dataList.stream().map(d -> getStringToObject(d.get(config.get("titleId")))).collect(Collectors.joining(","));
			String bzxrName = dataList.stream().map(d -> getStringToObject(d.get(config.get("bzxrName")))).collect(Collectors.joining(","));
			String bzxrId = dataList.stream().map(d -> getStringToObject(d.get(config.get("bzxrId")))).collect(Collectors.joining(","));
			String zxdwbh = dataList.stream().map(d -> getStringToObject(d.get(config.get("zxdwbh")))).collect(Collectors.joining(","));
			String zxdwName = dataList.stream().map(d -> getStringToObject(d.get(config.get("zxdwName")))).collect(Collectors.joining(","));
			logsInfo.setTitleName(titleName);
			logsInfo.setTitleId(titleId);
			logsInfo.setBzxrName(bzxrName);
			logsInfo.setBzxrId(bzxrId);
			logsInfo.setZxdwbh(zxdwbh);
			logsInfo.setZxdwName(zxdwName);
		}catch (Exception e){
			e.printStackTrace();
		}
	}
	public String getStringToObject(Object object){
		if(!org.springframework.util.StringUtils.isEmpty(object)){
			return object.toString();
		}
		return "";
	}


	public void setLog(String data){
		try{
			FileWriter write=new FileWriter("D:\\demo\\requstlog.txt",true);
			BufferedWriter bw=new BufferedWriter(write);
			bw.write(data+"\n");
			bw.close();
			write.close();
		}catch (Exception e){

		}

	}

	public List<Map<String, Object>> getFileList(String absolutepath,String batchId, Integer tableId,String isDel) {
		List<Map<String, Object>> listDataMap = new ArrayList<>();
		try{
			String path = absolutepath + "/excelFile" + batchId;
			FileInputStream fin = new FileInputStream(path + File.separator + batchId + ".txt");
			InputStreamReader reader = new InputStreamReader(fin);
			BufferedReader buffReader = new BufferedReader(reader);
			String strTmp = "";
			StringBuilder excelData = new StringBuilder();
			while((strTmp = buffReader.readLine())!=null){
				System.out.println(strTmp);
				excelData.append(strTmp);
			}
			buffReader.close();
			listDataMap = (List<Map<String, Object>>) com.alibaba.fastjson.JSONArray.parse(excelData.toString());
			if(!"".equals(isDel)){
				listDataMap = listDataMap.stream().filter(item->item.get("idDel").equals(isDel)).collect(Collectors.toList());
			}
			Table table = tableService.queryCubeById(tableId);
			String tableName = "t_" + table.getResourceId();
			List<Map<String,Object>> dataList = uploadPublicDao.selectDataByBatchId(tableName,batchId);
			for(Map<String,Object> data:listDataMap){
				for(Map<String,Object> data2:dataList){
					if(null!=data.get("MD5")&&(data.get("MD5").equals(data2.get("md5"))||data.get("MD5").equals(data2.get("MD5")))){
						if("推送失败".equals(data2.get("TSZT"))){
							data.put("errorMess","推送失败："+(data2.get("SBYY")==null?"":data2.get("SBYY")));
							data.put("idDel","1");
						}else{
							data.put("errorMess","");
							data.put("idDel","0");
						}
					}
				}
				if("1".equals(data.get("idDel"))){
					data.put("status","失败");
				}else{
					data.put("status","成功");
				}
			}
			writeLogsService.writeExcelFile(batchId, JSONArray.toJSONString(listDataMap), absolutepath);
		}catch (Exception e){
			e.printStackTrace();
		}
		return listDataMap;
	}
}
